<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
</body>
<script type="text/javascript">

    var gongchang = {}
    gongchang.chanyifu = function (argument) {
        this.gongren = 50
        this.yifu = this.gongren * 1
        // console.log(this)
        // alert('我们生产了' + yifu + '件衣服')
    }
    gongchang.chanxie = function () {
        alert('产鞋子～')
    }
    gongchang.yunshu = function () {
        alert('运输')
    }
    gongchang.changzhang = function (para) {
        // new 构造函数模式 单例模式
        return new gongchang[para]()
    }
    var me = gongchang.changzhang('chanyifu')
    alert(me.yifu)
</script>
</html>